<extend name="Base/mob_common"/>
<block name="mob_bottom">
    <div data-am-widget="navbar" class="am-navbar am-navbar-default am-cf " id="">
        <ul class="am-navbar-nav am-cf am-avg-sm-4" style="padding: 0px;font-size: 13px;background: #32b1f1">
            <li
            <if condition="($_GET['mark'] eq '0') or($_GET['mark'] eq '')">style="background: #0f9ae0"</if>
            >
            <a style="color: white" href="{:U('Mob/Question/index',array('mark'=>0))}">
                待回答
            </a>
            </li>
            <li
            <if condition="($_GET['mark'] eq '1')">style="background: #0f9ae0"</if>
            >
            <a style="color: white" href="{:U('Mob/Question/index',array('mark'=>1))}">
                热门问题
            </a>
            </li>
            <li
            <if condition="($_GET['mark'] eq '2')">style="background: #0f9ae0"</if>
            >
            <a style="color: white" href="{:U('Mob/Question/index',array('mark'=>2))}">
                我的问答
            </a>
            </li>
            <li
            <if condition="($_GET['mark'] eq '3')">style="background: #0f9ae0"</if>
            >
            <a style="color: white" href="{:U('Mob/Question/index',array('mark'=>3))}">
                全部问题
            </a>
            </li>
        </ul>
    </div>
</block>
<block name="mob_body">
    <script src="__JS__/question.js"></script>
    <link rel="stylesheet" href="__CSS__/apps/question.css"/>
    <div class="questiondetail-container">

        <div class="questiondetail">
            <div class="question am-cf" style="padding: 5px">
                <div class="question-title">
                    <h5>
                        <img src="__IMG__/question_32.png" class="">
                        {$question.title}
                    </h5>
                </div>
                <div class="question-info am-cf">
                      <span class=" question-author am-fl">
                      发布者：
                      <a>
                          <a href="{$question.user.space_mob_url}">{$question.user.nickname}</a>
                      </a>
                  </span>
                      <span class="question-type am-fl" style="margin-left: 10px">
                          问题所属分类：
                          <a class="question_type">{$question.category.title}</a>
                      </span>
                </div>

                <div class="question-content">

                    补充说明：

                    <span>
                        {$question.description}
                    </span>

                </div>
                <div class="catime">
                    创建时间：{$question.create_time|friendlyDate}
                </div>
                <php>if(is_administrator(is_login())||$question['uid']==is_login()){</php>
                <div class="am-fr">
                    <a href="{:U('Mob/Question/addQuestion',array('id'=>$question['id']))}">编辑</a></div>
                <php>}</php>
            </div>
        </div>
        <!--按钮部分-->
        <div class="am-g btn-box">
            <div class="am-u-sm-6  am-text-left">
                <span><i class="am-icon-comment-o"></i>{$question.answer_num}</span>

            </div>
            <div class="am-u-sm-6  am-text-right">
                <a href="{:U('Mob/Question/reply',array('id'=>$question['id']))}">我来回答</a>

            </div>
        </div>


        <div class="answer-list ulclass">
            <!--最佳答案部分-->
            <php>if($question['best_answer']!=0){</php>

            <span>最佳答案</span>

            <div class="answer answer-list" style="margin-bottom: 15px;border-bottom: 1px solid #cccccc;">
                <div class="answer-info am-fl">
                    <div class="author-avatar">
                        <img src="{$bestAnswer['user']['avatar32']}">
                    </div>
                    <php>if(is_null($bestAnswer['has_support'])){</php>

                    <div class="support-count am-icon-thumbs-o-up support_up" data-url="{:U('Mob/Question/support')}"
                         data-role="{$bestAnswer.id}">
                        <span class="up">{$bestAnswer.support}</span>
                    </div>
                    <br>

                    <div class="support-count am-icon-thumbs-o-down support_down"
                         data-url="{:U('Mob/Question/support')}" data-role="{$bestAnswer.id}">
                        <span class="down"> {$bestAnswer.oppose}</span>
                    </div>
                    <php>}else{</php>

                    <if condition="$bestAnswer['has_support']['type'] eq 1">
                        <div class="support-count am-icon-thumbs-up">
                            <span>{$bestAnswer.support}</span>
                        </div>
                        <br>

                        <div class="support-count am-icon-thumbs-o-down">
                            <span>{$bestAnswer.oppose}</span>
                        </div>
                        <else/>
                        <div class="support-count am-icon-thumbs-o-up">
                            <span>{$bestAnswer.support}</span>
                        </div>
                        <br>

                        <div class="support-count am-icon-thumbs-down">
                            <span>{$bestAnswer.oppose}</span>
                        </div>
                    </if>
                    <php>}</php>
                </div>
                <div class="answer-author am-cf">

                    <a href="{$bestAnswer.user.space_mob_url}">{$bestAnswer.user.nickname}</a>
                    <notempty name="bestAnswer['support_user']">
                        其中：
                        <volist name="bestAnswer['support_user']" id="v3">
                <span style="padding: 2px">
                <a href="{$v3.user.space_mob_url}">{$v3.user.nickname}</a>
                </span>
                        </volist>
                        表示赞同
                    </notempty>

                    <div class="am-fr">
                        <img src="__IMG__/best_answer.png"
                             style="width:14px;">
                    </div>
                    <div class="QA-content" style="">
                        {$bestAnswer.content}
                        {$bestAnswer.update_time}
                    </div>

                </div>
            </div>
            <php>}</php>
            <!--回答部分-->
            <volist name="questionComment" id="vl">
                <include file="_commentlist"/>
            </volist>
        </div>

    </div>
    <if condition="$pid['count'] eq 1">
        <div class="am-list-news-ft look-more">
            <a id="getmorequestioncommentlist" data-url="{:U('Mob/Question/addMoreQuestionCommentList')} "
               data-mark={$question.id}>查看更多 &raquo;</a>
        </div>
    </if>
    <script>
        set_best_answer();
        support_up();
        support_down();
    </script>

</block>